﻿using System;
using System.Collections.Generic;

namespace CMS.Constants
{
    internal static class Constant
    {
        /// <summary>
        /// 星期键值对
        /// </summary>
        public static readonly KeyValuePair<string, ushort>[] WeekMap = new KeyValuePair<string, ushort>[]
            {
                new KeyValuePair<string, ushort>("星期一",1),
                new KeyValuePair<string, ushort>("星期二",2),
                new KeyValuePair<string, ushort>("星期三",3),
                new KeyValuePair<string, ushort>("星期四",4),
                new KeyValuePair<string, ushort>("星期五",5),
                new KeyValuePair<string, ushort>("星期六",6),
                new KeyValuePair<string, ushort>("星期日",7),
            };


        /// <summary>
        /// 生成包含一系列周次的列表
        /// </summary>
        /// <returns></returns>
        public static List<KeyValuePair<string, uint>> GenClassWeekList()
        {
            List<KeyValuePair<string, uint>> classWeekList = new List<KeyValuePair<string, uint>>
            {
                new KeyValuePair<string, uint>("所有周次(1-20周)", 0xFFFFF),
                new KeyValuePair<string, uint>("上课周次(1-16周)", 0xFFFF),
                new KeyValuePair<string, uint>("前八周(1-8周)", 0xFF),
                new KeyValuePair<string, uint>("后八周(9-16周)", 0xFF00),
                new KeyValuePair<string, uint>("全部单周(1,3,5,7,9,11,13,15,17,19周)", 0x55555),
                new KeyValuePair<string, uint>("全部双周(2,4,6,8,10,12,14,16,18,20周)",0xAAAAA)
            };
            for (int i = 1; i <= 20; i++)
            {
                classWeekList.Add(new KeyValuePair<string, uint>($"仅显示第{i}周", 1u << (i - 1)));
            }
            classWeekList.AddRange(new KeyValuePair<string, uint>[]
            {
                new KeyValuePair<string, uint>("上课单周(1,3,5,7,9,11,13,15周)", 0x5555),
                new KeyValuePair<string, uint>("上课双周(2,4,6,8,10,12,14,16周)",0xAAAA),
                new KeyValuePair<string, uint>("前八单周(1,3,5,7周)", 0x55),
                new KeyValuePair<string, uint>("前八双周(2,4,6,8周)",0xAA),
                new KeyValuePair<string, uint>("后八单周(9,11,13,15周)", 0x5500),
                new KeyValuePair<string, uint>("后八双周(2,4,6,8,10,12,14,16周)",0xAA00)
            });

            return classWeekList;
        }




    }
}
